<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>打印</title>
  <style type="text/css">
    .print {
      font-size: 18px;
      text-indent: 2em;
      color: brown;
    }
  </style>
</head>

<body>
  <div id="print">
    <div class="print">要打印的内容要打印的内容要打印的内容要打印的内容要打印的内容要打印的内容要打印的内容要打印的内容要打印的内容要打印的内容...</div>
  </div>
</body>

</html>
<script type="text/javascript">
  window.print()
</script>
